package example.controller;

import example.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UploadController {

    @Autowired
    UploadService us;

    //上传字符串，名为firstKey,内容为str
    @RequestMapping("uploadstring")
    public String uploadstring(String firstKey,String str){
        us.uploadstring(firstKey,str);
        return "#";
    }

    //上传文件，名为fileKey
    @RequestMapping("uploadfile")
    public String uploadfile(String fileKey){
        us.uploadfile(fileKey);
        return "#";
    }

    //多线程上传文件，名为fileKey
    @RequestMapping("uploadthread")
    public String uploadthread(String fileKey) throws Throwable {
        us.uploadthread(fileKey);
        return "#";
    }

}
